<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>
          Google Web Toolkit
          
            -
            Internationalization</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<link href="../css/base.css" rel="stylesheet" type="text/css">
<link href="./doc.css" rel="stylesheet" type="text/css">
<link href="../css/print.css" rel="stylesheet" media="print" type="text/css">
</head>
<body>
<div id="gaia">&nbsp;</div>
<div id="header">
<div id="logo">
<a href="http://code.google.com/"><img src="http://code.google.com/images/code_sm.png" alt="Google"></a>
</div>
<div id="title">Google Web Toolkit (Beta)</div>
<div id="breadcrumbs">
<div id="nextprev">
<nobr><a href="com.google.gwt.doc.DeveloperGuide.JUnitIntegration.JUnitAsync.html">&laquo; prev</a></nobr><nobr><a href="com.google.gwt.doc.DeveloperGuide.Internationalization.StaticStringInternationalization.html">next &raquo;</a></nobr>
</div>
<span class="item"><a href="http://code.google.com/">Google Code Home</a></span>
        &gt;
        <span class="item"><a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a></span>
        &gt;
        
        <span class="item"><a xmlns="" href="com.google.gwt.doc.DeveloperGuide.html">Developer Guide</a></span> &gt;
						<span class="selected item">Internationalization</span>
</div>
</div>
<div id="side">
<div id="menu">
<h4>
<a href="http://code.google.com/webtoolkit/">Google Web Toolkit</a>
</h4>
<ul>
<li>
<a href="http://code.google.com/webtoolkit/download.html">Download GWT</a>
</li>
</ul>
<ul>
<li>
<a href="http://code.google.com/webtoolkit/overview.html">Product Overview</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/gettingstarted.html">Getting Started Guide</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/documentation/examples/">Example Projects</a>
</li>
</ul>
<ul>
<li>
<a class="selected" href="./com.google.gwt.doc.DeveloperGuide.html">Developer Guide</a>
</li>
<li>
<a href="./gwt.html">Class Reference</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/issues/">Issue Tracking</a>
</li>
<li>
<a href="http://groups.google.com/group/Google-Web-Toolkit">Developer Forum</a>
</li>
</ul>
<ul>
<li>
<a href="http://googlewebtoolkit.blogspot.com/">GWT Blog</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/faq.html">GWT FAQ</a>
</li>
<li>
<a href="http://code.google.com/webtoolkit/makinggwtbetter.html">Making GWT Better</a>
</li>
</ul>
<ul>
<li>
<a href="http://code.google.com/webtoolkit/thirdparty.html">Third Party Tools</a>
</li>
</ul>
</div>
<div id="search">
<form action="http://www.google.com/search" method="get">
<div>
<input name="domains" value="code.google.com" type="hidden"><input name="sitesearch" value="code.google.com" type="hidden">
<div class="header">Search this site:</div>
<div class="input">
<input name="q" size="10">
</div>
<div class="button">
<input value="Search" type="submit">
</div>
</div>
</form>
</div>
</div>
<div xmlns="http://www.w3.org/1999/xhtml" id="body">
<h1>Internationalization</h1>GWT includes a flexible set of tools to help you internationalize your
 applications and libraries. GWT internationalization support provides a
 variety of techniques to internationalize strings, typed values, and
 classes.
 
 <h2>Getting Started</h2>
 Since GWT supports a variety of ways of internationalizing your code, begin
 by researching which approach best matches your development requirements.
 
 <p>
<b>Are you writing code from scratch?</b>
<br>If so, you'll probably want
 to read up on GWT's
 <a xmlns="" href="com.google.gwt.doc.DeveloperGuide.Internationalization.StaticStringInternationalization.html">static string internationalization</a>
 techniques.
 </p>
<p>
<b>Do you want to internationalize mostly settings or end-user messages?</b>
<br> If you have mostly settings (the kind of thing for which you'd
 normally use simple properties files), consider
 <a href="com.google.gwt.i18n.client.Constants.html">Constants</a>. If you have a lot a of
 end-user messages, then <a href="com.google.gwt.i18n.client.Messages.html">Messages</a> is
 probably what you want.
 </p>
<p>
<b>Do you have existing localized properties files you'd like to reuse?</b>
<br> The
 <a href="com.google.gwt.doc.DeveloperGuide.Fundamentals.CommandLineTools.i18nCreator.html">i18nCreator tool</a>
 can automatically generate interfaces that extend either
 <a href="com.google.gwt.i18n.client.Constants.html">Constants</a> or
 <a href="com.google.gwt.i18n.client.Messages.html">Messages</a>.
 </p>
<p>
<b>Are you adding GWT functionality to an existing web application that
 already has a localization process defined?</b>
<br>
<a href="com.google.gwt.i18n.client.Dictionary.html">Dictionary</a> will help you interoperate
 with existing pages without requiring you to use
 <a href="com.google.gwt.doc.DeveloperGuide.Internationalization.SpecifyingLocale.html">GWT's concept of locale</a>.
 </p>
<p>
<b>Do you really just want a simple way to get properties files down to the
 client regardless of localization?</b>
<br> You can do that, too. Try
 using <a href="com.google.gwt.i18n.client.Constants.html">Constants</a> without
 <a href="com.google.gwt.doc.DeveloperGuide.Internationalization.SpecifyingLocale.html">specifying a locale</a>.
 </p>
<h2>Internationalization Techniques</h2>
 GWT offers multiple internationalization techniques to afford maximum
 flexibility to GWT developers and to make it possible to design for
 efficiency, maintainability, flexibility, and interoperability in whichever
 combinations are most useful.
 
 <p>
<a href="com.google.gwt.doc.DeveloperGuide.Internationalization.StaticStringInternationalization.html">Static string internationalization</a>
 refers to a family of efficient and type-safe techniques that rely on
 strongly-typed Java interfaces,
 <a href="com.google.gwt.doc.DeveloperGuide.Internationalization.PropertiesFiles.html">properties files</a>,
 and code generation to provide locale-aware messages and configuration
 settings. These techniques depend on the interfaces
 <a href="com.google.gwt.i18n.client.Constants.html">Constants</a> and
 <a href="com.google.gwt.i18n.client.Messages.html">Messages</a>.
 </p>
<p>
 At the other end of the spectrum,
 <a href="com.google.gwt.doc.DeveloperGuide.Internationalization.DynamicStringInternationalization.html">dynamic string internationalization</a>
 is a simplistic and flexible technique for looking up localized values
 defined in a module's
 <a href="com.google.gwt.doc.DeveloperGuide.Fundamentals.HostPage.html">host page</a>
 without needing to recompile your application. This technique is supported
 by the class <a href="com.google.gwt.i18n.client.Dictionary.html">Dictionary</a>.
 </p>
<p>
 Using an approach similar to static string internationalization, GWT also
 supports internationalizing sets of algorithms using locale-sensitive type
 substitution. This is an advanced technique that you probably will not need
 to use directly, although it is useful for implementing complex
 internationalized libraries. For details on this technique, see
 <a href="com.google.gwt.i18n.client.Localizable.html">Localizable</a>.
 </p>
<h2>The I18N Module</h2>
 The core types related to internationalization reside in the
 <code>com.google.gwt.i18n</code> package:
 
 <ul>
<li>
<a href="com.google.gwt.i18n.client.Constants.html">Constants</a>
<div>Useful for
 localizing typed constant values</div>
</li>
<li>
<a href="com.google.gwt.i18n.client.Messages.html">Messages</a>
<div>Useful for localizing
 messages requiring arguments</div>
</li>
<li>
<a href="com.google.gwt.i18n.client.ConstantsWithLookup.html">ConstantsWithLookup</a>
<div>Like
 <a href="com.google.gwt.i18n.client.Constants.html">Constants</a> but with extra lookup
 flexibility for highly data-driven applications</div>
</li>
<li>
<a href="com.google.gwt.i18n.client.Dictionary.html">Dictionary</a>
<div>Useful when adding
 a GWT module to existing localized web pages</div>
</li>
<li>
<a href="com.google.gwt.i18n.client.Localizable.html">Localizable</a>
<div>Useful for
 localizing algorithms encapsulated in a class</div>
</li>
</ul>
<p>
 The GWT internationalization types are included in the module
 <code>com.google.gwt.i18n.I18N</code>. To use any of these types, your
 module must inherit from it:
 
 <pre class="code">&lt;module&gt;
  &lt;!-- other inherited modules, such as com.google.gwt.user.User --&gt;
  &lt;inherits name="com.google.gwt.i18n.I18N"/&gt;
  &lt;!-- additional module settings --&gt;
&lt;/module&gt;
</pre>
</p>
<h2 xmlns="http://www.w3.org/1999/xhtml">Specifics</h2>
<ul class="featurelist">
<li>
<div class="heading">
<a xmlns="" href="com.google.gwt.doc.DeveloperGuide.Internationalization.StaticStringInternationalization.html">Static String Internationalization</a>
</div>
<div xmlns="http://www.w3.org/1999/xhtml">
<synopsis>A type-safe and optimized approach to internationalizing
           strings.</synopsis>
</div>
</li>
<li>
<div class="heading">
<a xmlns="" href="com.google.gwt.doc.DeveloperGuide.Internationalization.DynamicStringInternationalization.html">Dynamic String Internationalization</a>
</div>
<div xmlns="http://www.w3.org/1999/xhtml">
<synopsis>A flexible and simplistic method of internationalizing strings
           that easily integrates with existing web applications that do
           not support the GWT <code>locale</code> client property.</synopsis>
</div>
</li>
<li>
<div class="heading">
<a xmlns="" href="com.google.gwt.doc.DeveloperGuide.Internationalization.SpecifyingLocale.html">Specifying a Locale</a>
</div>
<div xmlns="http://www.w3.org/1999/xhtml">
<synopsis>How to add locales and specify the <code>locale</code> client
           property during deployment.</synopsis>
</div>
</li>
<li>
<div class="heading">
<a xmlns="" href="com.google.gwt.doc.DeveloperGuide.Internationalization.PropertiesFiles.html">Localized Properties Files</a>
</div>
<div xmlns="http://www.w3.org/1999/xhtml">
<synopsis>How to create localized properties files for use with
           <a xmlns="" href="com.google.gwt.i18n.client.Constants.html">Constants</a> or
           <a href="com.google.gwt.i18n.client.Messages.html">Messages</a>
</synopsis>
</div>
</li>
</ul>
</div>
<div id="footer" xmlns="http://www.w3.org/1999/xhtml">
          &copy;2007 Google
          <span class="noprint">
            -
            <a href="http://www.google.com/">Google Home</a>
            -
            <a href="http://www.google.com/jobs/">We're Hiring</a>
            -
            <a href="http://www.google.com/privacy.html">Privacy Policy</a>
            -
            <a href="http://www.google.com/terms_of_service.html">Terms of Service</a>
            -
            <a href="mailto:code@google.com">Contact Us</a></span>
<div id="license" style="text-align: center; margin: 1em 0em 1em 0em">
            Except as otherwise
            <a href="http://code.google.com/policies.html#restrictions">noted</a>, the content of this  page is licensed under the  <a rel="license" href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5 License</a>.
              <!--
            <rdf:RDF xmlns="http://web.resource.org/cc/">
<Work rdf:about="">
<license rdf:resource="http://creativecommons.org/licenses/by/2.5/"></license>
</Work>
<License rdf:about="http://creativecommons.org/licenses/by/2.5/">
<permits rdf:resource="http://web.resource.org/cc/Reproduction"></permits>
<permits rdf:resource="http://web.resource.org/cc/Distribution"></permits>
<requires rdf:resource="http://web.resource.org/cc/Notice"></requires>
<requires rdf:resource="http://web.resource.org/cc/Attribution"></requires>
<permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"></permits>
</License>
</rdf:RDF>
              -->
            </div>
</div>
<script src="https://ssl.google-analytics.com/urchin.js" type="text/javascript" xmlns="http://www.w3.org/1999/xhtml"></script><script type="text/javascript">
          _uacct="UA-18071-1"; _uanchor=1; urchinTracker();
        </script>
</body>
</html>
